<template>
  <div class="head">
    <div class="left"
         v-if="left">
      <van-icon name="revoke"
                @click="back" />
    </div>
    <div class="middle"
         v-if="middle">
      <slot name="middle"></slot>
    </div>
    <div class="right"
         v-if="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: ['left', 'right', 'middle'],
  methods: {
    back () {
      this.$emit('back')
    }
  }
}
</script>

<style lang="less" scoped>
.head {
  height: 50px;
  background-color: rgb(132, 211, 250);
  position: fixed;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 640px;
  width: 100%;
  z-index: 999;
  padding: 0 15px;
  box-sizing: border-box;
  .left {
    .van-icon {
      font-size: 30px;
    }
  }
}
</style>
